<?php
/**
 * Created by PhpStorm.
 * User: sqq
 * Date: 2018/07/12
 * Time: 12:00
 */

class RecommendedSeasonController extends BaseController {

    /**
     * @Author:      sqq
     * @DateTime:    2018-07-12 12:02:10
     * @Description: 当季推荐
     * @link: http://www.activity.com/ahp/ahp3.0/recommended_season_list?token=3de967e60c9bcd4b85a5858bac630b1c
     */
    public function recommended_season_list(){
//        $validator = Validator::make(Input::all(),
//            array(
//                'token' => 'required',
//            )
//        );
//        $response = array('code' => 0, 'msg' => 'ok');
        do{
//            if($validator->fails()) {
//                $response = Lang::get("error.args_error_10000");
//                $response["result"]=$validator->messages()->all();
//                break;
//            }
//            $mkt_user=$this->verificationUserToken(Input::get("token"),$response);
//            if(is_null($mkt_user)){
//                break;
//            }

            $recommended = RecommendedSeason::first();
            if(!empty($recommended)){
                $recommended->img_url = Config::get('config.ahp_upload_files_url');
                $recommended->url = Config::get('config.browse_url');
            }
            $response = array('code' => 0, 'msg' => 'ok', 'result' => $recommended);

        }while(false);
        Log::info("info", array("system" => "api3.0" ,"event" => "wechat/api3.0/recommended_season_list",  'input' =>Input::all() ,"output" => $response));
        return json_encode($response);
    }

}